package dto

import (
	"github.com/gin-gonic/gin"
	"tino_manager/public"
)

type SiteAddInput struct {
	Name         string  `json:"name" form:"name" comment:"场地名称" validate:"required"`
	Address      string  `json:"address" form:"address" comment:"场地地址" validate:"required"`
	Longitude    float64 `json:"longitude" form:"longitude" comment:"经度" validate:"required"`
	Latitude     float64 `json:"latitude" form:"latitude" comment:"纬度" validate:"required"`
	Phone        string  `json:"phone" form:"phone" comment:"手机号" validate:"required"`
	Image        string  `json:"image" form:"image" comment:"图片" validate:"required"`
	MaxPeopleNum string  `json:"max_people_num" form:"max_people_num" comment:"最大容纳人数" validate:"required"`
	Des          string  `json:"des" gorm:"column:des;comment:服务描述"`
	Facilities   string  `json:"facilities" form:"facilities" comment:"设施情况" validate:"required"`
	Options      string  `json:"options" form:"options" comment:"选项" validate:"required"`
	Service      string  `json:"service" form:"service" comment:"服务" validate:"required"`
	Business     string  `json:"business" form:"business" comment:"营业时间" validate:"required"`
	Mark         string  `json:"mark" form:"mark" comment:"预约须知"`
	Sort         int     `json:"sort" form:"sort" comment:"排序" validate:"required"`
}

func (params *SiteAddInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SiteUpdateInput struct {
	Id           string  `json:"id" form:"id" comment:"场地id" validate:"required"`
	Name         string  `json:"name" form:"name" comment:"场地名称" validate:"required"`
	Address      string  `json:"address" form:"address" comment:"场地地址" validate:"required"`
	Longitude    float64 `json:"longitude" form:"longitude" comment:"经度" validate:"required"`
	Latitude     float64 `json:"latitude" form:"latitude" comment:"纬度" validate:"required"`
	Phone        string  `json:"phone" form:"phone" comment:"手机号" validate:"required"`
	Image        string  `json:"image" form:"image" comment:"图片" validate:"required"`
	MaxPeopleNum string  `json:"max_people_num" form:"max_people_num" comment:"最大容纳人数" validate:"required"`
	Facilities   string  `json:"facilities" form:"facilities" comment:"设施情况" validate:"required"`
	Des          string  `json:"des" gorm:"column:des;comment:服务描述"`
	Options      string  `json:"options" form:"options" comment:"选项" validate:"required"`
	Service      string  `json:"service" form:"service" comment:"服务" validate:"required"`
	Business     string  `json:"business" form:"business" comment:"营业时间" validate:"required"`
	Mark         string  `json:"mark" form:"mark" comment:"预约须知"`
	Sort         int     `json:"sort" form:"sort" comment:"排序" validate:"required"`
}

func (params *SiteUpdateInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SitePageInput struct {
	Keyword    string  `json:"keyword" form:"keyword" comment:"关键字"`
	Type       string  `json:"type" form:"type"`
	PageSize   int     `json:"page_size" form:"page_size" comment:"每页数量" validate:"required,lte=20"`
	PageNumber int     `json:"page_number" form:"page_number" comment:"页码" validate:"required"`
	Longitude  float64 `json:"longitude" form:"longitude" comment:"经度"`
	Latitude   float64 `json:"latitude" form:"latitude" comment:"纬度"`
}

func (params *SitePageInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SiteInfo struct {
	Id                string  `json:"id"`
	Name              string  `json:"name" form:"name"`
	Address           string  `json:"address" form:"address"`
	Longitude         float64 `json:"longitude" form:"longitude"`
	Latitude          float64 `json:"latitude" form:"latitude"`
	Image             string  `json:"image" form:"image"`
	MaxPeopleNum      string  `json:"max_people_num" form:"max_people_num"`
	Facilities        string  `json:"facilities" form:"facilities"`
	Phone             string  `json:"phone" form:"phone"`
	Service           string  `json:"service" form:"service"`
	Des               string  `json:"des" gorm:"column:des;comment:服务描述"`
	Business          string  `json:"business" form:"business"`
	Options           string  `json:"options" form:"options"`
	Sort              int     `json:"sort" form:"sort"`
	Status            uint8   `json:"status" form:"status"`
	ReservationStatus uint8   `json:"reservation_status" form:"reservation_status"`
	Mark              string  `json:"mark" form:"mark"`
	IsDelete          uint8   `json:"is_delete" form:"is_delete"`
	UpdatedAt         string  `json:"update_at" gorm:"column:update_at;comment:更新时间"`
	CreatedAt         string  `json:"create_at" gorm:"column:create_at;comment:创建时间"`
}
type SitePageOutput struct {
	List  []SiteInfo `json:"list"`
	Total int64      `json:"total"`
}
type SiteDetailInput struct {
	Id string `json:"id" form:"id" comment:"场地id" validate:"required"`
}

func (params *SiteDetailInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type SiteUpdateStatusInput struct {
	Id     string `json:"id" form:"id" comment:"场地id" validate:"required"`
	Status uint8  `json:"status" form:"status" comment:"状态"`
}

func (params *SiteUpdateStatusInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type ReservationClearInput struct {
	SiteId string `json:"site_id" form:"site_id" comment:"场地id" validate:"required"`
}

func (params *ReservationClearInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type RemoveInput struct {
	Id string `json:"id" form:"id" comment:"场地id" validate:"required"`
}

func (params *RemoveInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}
